#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    connect(&opengl_widget, SIGNAL(close_app(bool)), this, SLOT(on_pushButton_clicked(bool)));
    ui->opengl_container->addWidget(&opengl_widget);

    connect(&opengl_widget, SIGNAL(sendAngleX(float)), &view_horizon, SLOT(setAngle(float)));
    ui->btn_layout->addWidget(&view_horizon);

    btn_quitte.setText("Quitter");
    connect(&btn_quitte, SIGNAL(clicked(bool)), this, SLOT(on_pushButton_clicked(bool)));
    ui->btn_layout->addWidget(&btn_quitte);

    opengl_widget.setFocus();
}

Dialog::~Dialog()
{
    delete ui;
}


void Dialog::on_pushButton_clicked(bool checked)
{
    this->close();
}
